﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Id"] == null)
        {
            Response.Redirect("~/Pages/HomePage/Login.aspx");
        }
        else
        {
            lblUser.Text = "Welcome " + Session["UserName"].ToString();
        }
    }
    protected void btnLogout_Click(object sender, EventArgs e)
    {
        Session["Id"] = null;
        Session["UserName"] = null;
        Response.Redirect(Request.RawUrl);
    }
}
